package santeclair.referentiel.chirurgie.webservice.mock;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.NoResultException;

import santeclair.referentiel.bean.Ville;
import santeclair.referentiel.chirurgie.domaine.EtablissementChirurgie;
import santeclair.referentiel.chirurgie.service.CivilitePraticienService;
import santeclair.referentiel.chirurgie.service.EtablissementChirurgieService;

/**
 * Class mockant le service {@link CivilitePraticienService}
 * 
 * @author ldelemotte
 * 
 */
public class EtablissementChirurgieServiceMock implements EtablissementChirurgieService {

    /**
     * {@inheritDoc}<br>
     * <b>MOCK !</b>
     */
    @Override
    public List<EtablissementChirurgie> findByVille(String ville) {
        List<EtablissementChirurgie> mockResult = new ArrayList<>();

        Ville villeMock1 = new Ville();
		villeMock1.setCode("01003-01090");
		villeMock1.setCodeInsee("01003");
		villeMock1.setCodePostal("01090");
		villeMock1.setIsCedex(false);
		villeMock1.setIsVisible(true);
		villeMock1.setLatitude(new BigDecimal(46.0736374));
		villeMock1.setLongitude(new BigDecimal(4.8086930));
		villeMock1.setNom("AMAREINS");
        
        EtablissementChirurgie etab1 = new EtablissementChirurgie();
        etab1.setCode("00000001");
        etab1.setLibelle("Etab test 1");
        etab1.setFiness("00000001F");
        etab1.setVille(villeMock1);
        mockResult.add(etab1);

        EtablissementChirurgie etab2 = new EtablissementChirurgie();
        etab2.setCode("00000002");
        etab2.setLibelle("Etab test 2");
        etab2.setFiness("00000002F");
        etab2.setVille(villeMock1);
        mockResult.add(etab2);

        return mockResult;
    }

	@Override
	public List<EtablissementChirurgie> findByDepartement(String departement) {
        List<EtablissementChirurgie> mockResult = new ArrayList<>();

        Ville villeMock1 = new Ville();
		villeMock1.setCode("01003-01090");
		villeMock1.setCodeInsee("01003");
		villeMock1.setCodePostal("01090");
		villeMock1.setIsCedex(false);
		villeMock1.setIsVisible(true);
		villeMock1.setLatitude(new BigDecimal(46.0736374));
		villeMock1.setLongitude(new BigDecimal(4.8086930));
		villeMock1.setNom("AMAREINS");
		
        EtablissementChirurgie etab1 = new EtablissementChirurgie();
        etab1.setCode("00000001");
        etab1.setLibelle("Etab test 1");
        etab1.setFiness("00000001F");
        etab1.setVille(villeMock1);
        mockResult.add(etab1);

        EtablissementChirurgie etab2 = new EtablissementChirurgie();
        etab2.setCode("00000002");
        etab2.setLibelle("Etab test 2");
        etab2.setFiness("00000002F");
        etab2.setVille(villeMock1);
        mockResult.add(etab2);

        return mockResult;
	}

	@Override
	public EtablissementChirurgie getByCode(String codeEtablissementChirurgie) throws NoResultException {
		Ville villeMock1 = new Ville();
		villeMock1.setCode("01003-01090");
		villeMock1.setCodeInsee("01003");
		villeMock1.setCodePostal("01090");
		villeMock1.setIsCedex(false);
		villeMock1.setIsVisible(true);
		villeMock1.setLatitude(new BigDecimal(46.0736374));
		villeMock1.setLongitude(new BigDecimal(4.8086930));
		villeMock1.setNom("AMAREINS");

		EtablissementChirurgie etab1 = new EtablissementChirurgie();
		etab1.setCode("00000001");
		etab1.setLibelle("Etab test 1");
		etab1.setFiness("00000001F");
		etab1.setVille(villeMock1);

		return etab1;
	}

}
